import { useState, useEffect } from "react";
import "./index.less";
import { Modal } from 'antd';
import { request } from "../../../../../../../common/request";
import { urls } from "../../../../../../../common/urls";

function ClearCache() {
  const [isModalOpen, setIsModalOpen] = useState(false);

  const handleBtn = () => {
    setIsModalOpen(true);
  };

  const handleOk = () => {
    setIsModalOpen(false);
  };

  const handleCancel = () => {
    setIsModalOpen(false);
  };

  return (
    <>
      <div className="clearCache-page text-style">
        <div className="clearCache-page-btn" onClick={ handleBtn }>清除缓存</div>
      </div>
      <Modal
        open={ isModalOpen }
        onOk={ handleOk }
        onCancel={ handleCancel }
        okText="确认"
        cancelText="取消"
        centered
      >
        <div className="clearCache-tips text-style">确定清除缓存?</div>
      </Modal>
    </>
  );
}

export default ClearCache;
